﻿@section js{
    <script src="~/Scripts/swfupload/swfupload.js"></script>
}
<div style="padding: 10px;">
    <table style="width: 100%;">
        <tr>
            <td>
                <input id="fileupload1" name="gimage" class="mini-fileupload" style="width: 80%;"
                    flashurl="../../../../Scripts/swfupload/swfupload.swf" uploadurl="SaveImage" onuploadsuccess="onUploadSuccess" />
            </td>
            <td style="width: 20%;">
                <input type="button" value="上传" onclick="startUpload()" />
            </td>
        </tr>
    </table>
    <img alt="logo" id="appImage" src="" style="overflow: hidden; margin-top: 20px;" />
</div>
<script type="text/javascript">

    mini.parse();

    var gid;
    var fileupload = mini.get("fileupload1");

    function SetData(e) {
        var f = mini.clone(e);
        gid = f.GID;
        $.post("GetImage", { GID: gid }, function (e) {
            $("#appImage").attr("src", e);
        });
    }

    function onUploadSuccess(e) {
        $("#appImage").attr("src", e.serverData);
        this.setText("");
    }

    function startUpload() {
        fileupload.setPostParam({ GID: gid });
        fileupload.startUpload();
    }


</script>
